﻿using MediatR;
using SheepStorage.API.Application.Command.YourTableNameCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Domain.Dto;
using SheepStorage.Domain.Entity;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandler
{
    public class YourTableNamebackfillCommandHandler : IRequestHandler<YourTableNamebackfillCommand, Results<YourTableName>>
    {
        private readonly IYourTableNameService _yourTableName;
        public YourTableNamebackfillCommandHandler(IYourTableNameService yourTableName)
        {
            _yourTableName = yourTableName;
        }

        public async Task<Results<YourTableName>> Handle(YourTableNamebackfillCommand request, CancellationToken cancellationToken)
        {
            return Results<YourTableName>.DataResult( _yourTableName.backfillYourTableNames(request.DawningsheepId));
        }
    }
}
